package org.scohen.juploadr.uploadapi.flickrrest.photosets;

import org.scohen.juploadr.app.PhotoSet;
import org.scohen.juploadr.uploadapi.flickrrest.DefaultFlickrHandler;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

public class CreatePhotoSetResponseHandler extends DefaultFlickrHandler {
    private PhotoSet set;

    public CreatePhotoSetResponseHandler(Object parent) {
        super(parent);
        set = (PhotoSet) parent;
    }

    public void startElement(String uri, String localName, String qname,
            Attributes atts) throws SAXException {
        super.startElement(uri, localName, qname, atts);
        if ("photoset".equals(qname)) {
            set.setId(atts.getValue("id"));
            set.setUrl(atts.getValue("url"));
        }
    }

}
